<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="../js/tools.js"></script>
    <script>

        // 1 随机一个数，判断是不是质数
        var m = rand(0,100) ;
        var res = isZhi(m) ;
        if(res) {
            document.write(m + '是一个质数') ;
        }
        else {
            document.write(m + '不是一个质数') ;
        }



        // 2 输出100以内的质数
        for(var i = 2 ; i <= 100 ; i++) {
            if(isZhi(i)) {
                document.write(i + ' ') ;
            }
        }

    </script>
    
</body>
</html>